# 九九乘法表method1 for循环
for j in range(1,10):
    k = 9 * (9-j)
    print(" "*k,end=" ")
    for i in range(j,0,-1):
        print("{}*{}={:<4}".format(i,j,i*j),end=" ")
    print("")

# 九九乘法表method1 while循环
j=1
while j<=9:
    k = 9 * (9-j)
    print(" "*k,end=" ")
    i=j
    while i>=1:
        print("{}*{}={:<4}".format(i,j,i*j),end=" ")
        i-=1
    print("")
    j+=1
print("="*40)

# 九九乘法表method2 for循环
for j in range(9,0,-1):
    k = 9 * (9-j)
    print(" "*k,end=" ")
    for i in range(j,0,-1):
        print("{}*{}={:<4}".format(i,j,i*j),end=" ")
    print("")

# 九九乘法表method2 while循环
j=9
while j>=1:
    k = 9 * (9-j)
    print(" "*k,end=" ")
    i=j
    while i>=1:
        print("{}*{}={:<4}".format(i,j,i*j),end=" ")
        i-=1
    print("")
    j-=1
print("="*40)

# 九九乘法表method3 for循环
for j in range(1,10):
    for i in range(1,j+1):
        print("{}*{}={:<4}".format(i,j,i*j),end=" ")
    print("")

# 九九乘法表method3 while循环
j=1
while j<=9:
    i=1
    while i<=j:
        print("{}*{}={:<4}".format(i,j,i*j),end=" ")
        i+=1
    print("")
    j+=1

print("="*40)


# 九九乘法表method4 for循环
for j in range(9,0,-1):
    for i in range(1,j+1):
        print("{}*{}={:<4}".format(i,j,i*j),end=" ")
    print("")

# 九九乘法表method4 while循环
j=9
while j>=1:
    i=1
    while i<=j:
        print("{}*{}={:<4}".format(i,j,i*j),end=" ")
        i+=1
    print("")
    j-=1